package top.kent90.service;

import com.github.pagehelper.PageHelper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import top.kent90.dao.ZczyOrderDao;
import top.kent90.pojo.ZczyOrder;

import java.util.List;
@Service
public class ZczyOrderServiceImpl implements ZczyOrderService{
    @Autowired
    private ZczyOrderDao zczyOrderDao;

    @Override
    public List<ZczyOrder> findAll(int page, int size) throws Exception {
        PageHelper.startPage(1,5);
        return zczyOrderDao.findAll(page, size);
    }
    @Override
    public ZczyOrder findById(Integer orderId) throws Exception {
        return zczyOrderDao.findById(orderId);
    }


    @Override
    public int delAll(Integer orderId) throws Exception {
        return zczyOrderDao.delAll(orderId);
    }

    @Override
    public int deleteById(Integer orderId) throws Exception {

        return zczyOrderDao.deleteById(orderId);
    }

    @Override
    public int add(ZczyOrder zczyOrder) throws Exception {
        return zczyOrderDao.add(zczyOrder);

    }


    @Override
    public ZczyOrder updateById(ZczyOrder zczyOrder) throws Exception {
        return zczyOrderDao.updateById(zczyOrder);

    }
}
